package com.ruoyi.system.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.apache.commons.lang3.StringUtils;
import com.ruoyi.common.annotation.DataScope;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.StudentInfoMapper;
import com.ruoyi.system.domain.StudentInfo;
import com.ruoyi.system.service.IStudentInfoService;

/**
 * 学生管理Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-03-07
 */
@Service
public class StudentInfoServiceImpl extends ServiceImpl<StudentInfoMapper, StudentInfo> implements IStudentInfoService
{
    @Autowired
    private StudentInfoMapper studentInfoMapper;


    /**
     * 查询学生管理列表
     *
     * @param studentInfo 学生管理
     * @return 学生管理
     */
    @Override
    public List<StudentInfo> queryList(StudentInfo studentInfo)
    {
        QueryWrapper<StudentInfo> queryWrapper = Wrappers.query();
            if(StringUtils.isNotEmpty(studentInfo.getNaem())){
                queryWrapper.ne("naem", studentInfo.getNaem());
            }
            if(StringUtils.isNotEmpty(studentInfo.getPhone())){
                queryWrapper.ge("phone", studentInfo.getPhone());
            }
            if(StringUtils.isNotEmpty(studentInfo.getStatus())){
                queryWrapper.le("status", studentInfo.getStatus());
            }
            if(StringUtils.isNotEmpty(studentInfo.getClassName())){
                queryWrapper.like("class_name", studentInfo.getClassName());
            }

        return this.list(queryWrapper);
    }

    
    /**
     * 查询学生管理  按部门 角色 权限查询
     * 
     * @param id 学生管理主键
     * @return 学生管理
     */
    @Override
    @DataScope(deptAlias = "d",userAlias="u")
    public List<StudentInfo> selectStudentInfoList(StudentInfo studentInfo)
    {
        return studentInfoMapper.selectStudentInfoList(studentInfo);
    }

    
}
